from django.db import models
from django.contrib.auth.models import User

class Question(models.Model):
    summary = models.TextField()
    description = models.TextField()
    user = models.ForeignKey(User)
    
    date_created = models.DateTimeField(auto_now_add = True, auto_now = False)
    date_modified = models.DateTimeField(auto_now_add = False, auto_now = True)
        
class Answer(models.Model):
    description = models.TextField()
    accepted = models.BooleanField(default = False)
    question = models.ForeignKey(Question,  related_name = 'answers')
    user = models.ForeignKey(User)
    
    date_created = models.DateTimeField(auto_now_add = True, auto_now = False)
    date_modified = models.DateTimeField(auto_now_add = False, auto_now = True)